package com.service;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dao.DepDAO;
import com.pojo.Dep;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.security.auth.callback.Callback;

@SuppressWarnings("ALL")
@Service
public class DepService extends ServiceImpl<DepDAO, Dep> {

    @Autowired
    private  DepDAO depDAO;


    //@Transactional(rollbackFor = Exception.class)
    public int addDep(Dep dep) throws  Exception
    {
        int n = depDAO.insert(dep);

        //int x  = 1/0;
       if (true)
           throw new Exception("出西西了");

        return n;
    }



}
